import 'package:FiduMart/generated/json/base/json_convert_content.dart';
import 'package:FiduMart/core/network/model/invite_info_entity.dart';

InviteInfoEntity $InviteInfoEntityFromJson(Map<String, dynamic> json) {
  final InviteInfoEntity inviteInfoEntity = InviteInfoEntity();
  final String? avatar = jsonConvert.convert<String>(json['Avatar']);
  if (avatar != null) {
    inviteInfoEntity.avatar = avatar;
  }
  final String? nickName = jsonConvert.convert<String>(json['NickName']);
  if (nickName != null) {
    inviteInfoEntity.nickName = nickName;
  }
  final int? balance = jsonConvert.convert<int>(json['Balance']);
  if (balance != null) {
    inviteInfoEntity.balance = balance;
  }
  final String? guildAvatar = jsonConvert.convert<String>(json['GuildAvatar']);
  if (guildAvatar != null) {
    inviteInfoEntity.guildAvatar = guildAvatar;
  }
  final String? guildName = jsonConvert.convert<String>(json['GuildName']);
  if (guildName != null) {
    inviteInfoEntity.guildName = guildName;
  }
  final bool? isBound = jsonConvert.convert<bool>(json['IsBound']);
  if (isBound != null) {
    inviteInfoEntity.isBound = isBound;
  }
  final int? gameUserBindType = jsonConvert.convert<int>(
      json['GameUserBindType']);
  if (gameUserBindType != null) {
    inviteInfoEntity.gameUserBindType = gameUserBindType;
  }
  final String? gameUserEmail = jsonConvert.convert<String>(
      json['GameUserEmail']);
  if (gameUserEmail != null) {
    inviteInfoEntity.gameUserEmail = gameUserEmail;
  }
  final String? shareUrl = jsonConvert.convert<String>(json['ShareUrl']);
  if (shareUrl != null) {
    inviteInfoEntity.shareUrl = shareUrl;
  }
  final String? inviterEmail = jsonConvert.convert<String>(
      json['InviterEmail']);
  if (inviterEmail != null) {
    inviteInfoEntity.inviterEmail = inviterEmail;
  }
  return inviteInfoEntity;
}

Map<String, dynamic> $InviteInfoEntityToJson(InviteInfoEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['Avatar'] = entity.avatar;
  data['NickName'] = entity.nickName;
  data['Balance'] = entity.balance;
  data['GuildAvatar'] = entity.guildAvatar;
  data['GuildName'] = entity.guildName;
  data['IsBound'] = entity.isBound;
  data['GameUserBindType'] = entity.gameUserBindType;
  data['GameUserEmail'] = entity.gameUserEmail;
  data['ShareUrl'] = entity.shareUrl;
  data['InviterEmail'] = entity.inviterEmail;
  return data;
}

extension InviteInfoEntityExt on InviteInfoEntity {
  InviteInfoEntity copyWith({
    String? avatar,
    String? nickName,
    int? balance,
    String? guildAvatar,
    String? guildName,
    bool? isBound,
    int? gameUserBindType,
    String? gameUserEmail,
    String? shareUrl,
    String? inviterEmail,
  }) {
    return InviteInfoEntity()
      ..avatar = avatar ?? this.avatar
      ..nickName = nickName ?? this.nickName
      ..balance = balance ?? this.balance
      ..guildAvatar = guildAvatar ?? this.guildAvatar
      ..guildName = guildName ?? this.guildName
      ..isBound = isBound ?? this.isBound
      ..gameUserBindType = gameUserBindType ?? this.gameUserBindType
      ..gameUserEmail = gameUserEmail ?? this.gameUserEmail
      ..shareUrl = shareUrl ?? this.shareUrl
      ..inviterEmail = inviterEmail ?? this.inviterEmail;
  }
}